<?php
//session_start();

include("../includes/custom/bal_poa.php");

$bal = new BAL();

$products = $bal->getProductsList();

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>PO Approval System - Bitzer</title>
    </head>
    <body>
            <form name="posEntry"
                     action="submitForm.php"
		     method="POST"
                     enctype="multipart/form-data"
                     data-bitzer-data-url="orderData.php"
                     data-bitzer-desc="PO Entry"
                     data-bitzer-online-only="true"
                     data-bitzer-pagination="true"
                     data-bitzer-sync-scheme="WEBAPP_SOFT"
                     data-bitzer-title="PO Entry"
                     data-bitzer-type="COMPONENT"
                     >

                    <input type="hidden" name="oid" value=""
                           data-bitzer-primary-key="true"
                           data-bitzer-type="integer">

                    <table class="posForm" width="100%">
                        <tr>
                            <td>
                                <input
                                       type="text"
                                       name="name"
                                       value=""
                                       data-bitzer-label="Name"
                                       data-bitzer-type="string"
                                       data-bitzer-help-text="Enter your name"
                                       data-bitzer-display-group-name="OrderInfo"
                                       data-bitzer-display-group-order="1"
                                       data-bitzer-display-group-title="Submit Order"
                                />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <select
                                        name="product_name"
                                        data-bitzer-label="Product"
                                        data-bitzer-type="string"
                                        data-bitzer-display-group-name="OrderInfo">

                                    <?php

                                    if(is_array($products))
                                    {

                                        foreach($products as $product)
                                        {
                                        ?>

                                        <option value="<?php echo $product["pid"]; ?>"><?php echo $product["product_name"]; ?></option>

                                    <?php
                                        }
                                    }
                                    else
                                    {
                                    ?>
                                        <option value="-1">No products to display</option>
                                    <?php
                                    }
                                    ?>

                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <input
                                       type="text"
                                       name="description"
                                       value=""
                                       data-bitzer-label="Details"
                                       data-bitzer-type="string"
                                       data-bitzer-help-text=""
                                       data-bitzer-display-group-name="OrderInfo"
                                />
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <input
                                       readonly
                                       type="text"
                                       name="lastModifiedOn"
                                       value=""
                                       data-bitzer-label="Modified On"
                                       data-bitzer-help-text="The record was last modified on this date."
                                       data-bitzer-type="datetime"
                                       data-bitzer-read-only="true"
                               />
                            </td>

                        </tr>
             </table>
      </form>
    </body>
</html>